﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WR.BL.BE;
using WR.DL.DALC.SAP;

namespace WR.BL.BCC
{
    public class MaterialBC
    {
        private string _connId = string.Empty;

        #region Singleton
        public static MaterialBC getInstance(string pConnId)
        {
            if (_instance == null)
            {
                lock (typeof(MaterialBC))
                {
                    if (_instance == null)
                    {
                        _instance = new MaterialBC(pConnId);
                    }
                }
            }
            return _instance;
        }
        private MaterialBC(string pConnId) { this._connId = pConnId; }
        private static volatile MaterialBC _instance = null;
        #endregion


        public MaterialBE read(string pTienda, string pCod)
        {
            return MaterialDALC.getInstance(this._connId).read(pTienda, pCod);
        }

        public List<MaterialBE> find(string pTienda, string pCod, string pDesc)
        {
            return MaterialDALC.getInstance(this._connId).find(pTienda, pCod, pDesc);
        }

        public List<MaterialBE> list(string pTienda)
        {
            return MaterialDALC.getInstance(this._connId).list(pTienda);
        }
    }
}
